package com.ifar.audiosdk.model.main.adapter

import android.graphics.Color
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ifar.audiosdk.R
import com.ifar.audiosdk.model.main.model.UserListEntityItem

class UserListAdapter(data: MutableList<UserListEntityItem>) :
    BaseQuickAdapter<UserListEntityItem, BaseViewHolder>(R.layout.item_user_list, data) {

    override fun convert(holder: BaseViewHolder, item: UserListEntityItem) {
        holder.setText(R.id.tvUserName, item.nickname)
        holder.setBackgroundColor(
            R.id.tvUserName,
            Color.parseColor(
                if (item.is_signin == "1") {
                    "#FFBB86FC"
                } else {
                    "#00000000"
                }
            )
        )

    }
}